package com.ydzh.kfqgwvisitor.controller;


import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.ydzh.kfqgwvisitor.base.Result;
import com.ydzh.kfqgwvisitor.service.BeVisitorService;
import com.ydzh.kfqgwvisitor.vo.BeVisitorVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 被访人信息表  前端控制器
 * </p>
 *
 * @author zcj
 * @since 2021-09-01
 */
@RestController
@RequestMapping("/beVisitor")
@Api(tags = "领导")
public class BeVisitorController {

    @Autowired
    private BeVisitorService beVisitorService;

    /**
     * @description: 领导集合
     * @param: []
     * @return: com.ydzh.kfqgwvisitor.vo.Result<java.util.List < com.ydzh.kfqgwvisitor.vo.BeVisitorVO>>
     * @author: zcj
     * @date: 2021/9/1
     */
    @ApiOperation(value = "领导集合")
    @GetMapping("/leaderList")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "unitId", value = "单位id"),
            @ApiImplicitParam(name = "departmentId", value = "部门id"),
    })
    @ApiOperationSupport(order = 1)
    public Result<List<BeVisitorVO>> leaderList(Long unitId, Long departmentId) {
        List<BeVisitorVO> list = beVisitorService.listToAll(unitId, departmentId);
        return Result.buildSuccess(list);
    }


}

